|
|
|
|
|
|
|
Learn to use the data-aware combo box, list box, and grid |
|
|
|
|
|
|
|
|
Learn to display the number of records in the Recordset |
|
|
|
|
|
|
|
|
Create your own data movement command buttons |
|
|
|
|
|
|
|
|
Find records in the Recordset |
|
|
|
|
|
|
|
|
Sample Project File: \Chapter14\DCTopics.vbp |
|
|
|
|
|
|
|
|
Other Data-aware Controls |
|
|
|
|
|
|
|
|
Besides text box and check box controls, other data-aware controls ship with Visual Basicfor example, the data-aware combo box, list box, and grid control can also be manipulated with the data control. These data-aware controls are very robust. Lets try each of these controls to see how they work. |
|
|
|
|
|
|
|
|
The data-bound combo box (DataCombo) is used when you need to load a combo box with a list of values and have that control updated to the value contained in your main table. You have a classic foreign key example within the Employee table, and you have a State ID field that relates to the State table in the same database. All the values in the State ID field must be a part of the State table. Lets add a DataCombo to your form in place of the existing State combo box. However, youll first need to load a new component to get the DataCombo control into the toolbox. |
|
|
|
|
|
|
|
|
Examples Filename: DataCombo.frm |
|
|
|
|
| Add the Data List Controls to Your Project 1. Select Project, Components from the Visual Basic menu. 2. Check the Microsoft DataList Controls 6.0 (OLEDB) option from the list and then click the OK button. |  | There should be two new tools added to your toolbox after selecting this component. One is the data-bound combo box (DataCombo) and the other is the data-bound list box (DataList). Figure 14.1 shows what the DataCombo control looks like in the toolbox. |
|
|
|